<template>
    <div>
        <van-cell-group>
            <van-cell title="设置姓名"/>
            </van-cell-group>       
            <van-cell-group>
                <van-cell-group>
                    <van-field v-model="nameV" label="姓名" :placeholder="uname" />
                </van-cell-group>       
            </van-cell-group>       
            <van-cell-group>
                <van-cell style="width:150px;margin:auto">
                    <van-button round type="primary" block size="small" style="margin-bottom:10px" @click="confirom">确认</van-button>
                    <van-button round type="default" block size="small" @click="cancel">取消</van-button>
            </van-cell>
        </van-cell-group>
    </div>
</template>

<script>
    export default {
        name:"tan1",
        data() {
            return {
                nameV:""
            }
        },
        props:[
            'username'
        ],
        computed: {
            uname () {
                if(this.username == "未绑定") {
                    return "请输入姓名"
                } else {
                    return this.username
                }
            }
            
        },
        methods: {
            confirom : function() {
                this.$emit("getName")
            },
            cancel : function() {
                this.$emit("quxiao")
            }
        }
    }
</script>

<style scoped>

</style>